dagga 🌿
A crate for scheduling directed acyclic graphs.
Features
- node
creates
resources semantics - node
reads
resource semantics, ie borrow writes
resource semantics, ie mutable/exclusive borrowconsumes
resource semantics, ie move- node dependencies
- node X must run before node Y
- node X must run after node Y
- barriers - nodes added before a barrier will always be scheduled before the barrier and nodes added after a barrier will always be scheduled after the barrier
Example uses
- scheduling parallel operations with dependencies, shared and exclusive resources
- scheduling steps in a render graph
- scheduling system batches in ECS
- scheduling audio nodes in an audio graph
Example
use *;
// Create names/values for our resources.
//
// These represent the types of the resources that get created, passed through
// and consumed by each node.
let : = ;
// Add the nodes with their dependencies and build the schedule.
// The order they are added should not matter (it may cause differences in
// scheduling, but always result in a valid schedule).
let dag = default
.with_node
.with_node
.with_node
.with_node
.with_node;
assert_batches;
You can also have dagga
create a dot graph file to visualize the schedule (using graphiz or similar):